import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    component: () => import("@/view/Home/Home.vue"),
    children: [
      //创建分类
      {
        path: "/home/createClass",
        component: () => import("@/view/CreateClass/CreateClass.vue"),
      },
      //分类列表
      {
        path: "/home/categoryList",
        component: () => import("@/view/CategoryList/CategoryList.vue"),
      },
      //编辑分类跳转
      {
        path: "/home/createClass/editCategory/:id",
        name: "editCategory",
        component: () => import("@/view/CreateClass/CreateClass.vue"),
      },
      //添加物品
      {
        path: "/home/ItemEdit",
        component: () => import("@/view/ItemEdit/ItemEdit.vue"),
      },
      //物品列表
      {
        path: "/home/ItemList",
        component: () => import("@/view/ItemList/ItemList.vue"),
      },
      //点击编辑跳转添加物品组件
      {
        path: "/home/itemEdit/editItem/:id",
        name: "editItem",
        component: () => import("@/view/ItemEdit/ItemEdit.vue"),
      },
      //添加英雄

      {
        path: "/home/herosEdit",
        component: () => import("@/view/HerosEdit/HerosEdit.vue"),
      },
      //英雄列表
      {
        path: "/home/herosList",
        component: () => import("@/view/HerosList/HerosList.vue"),
      },
      //点击编辑跳转添加英雄组件
      {
        path: "/home/herosEdit/editHeros/:id",
        name: "editHeros",
        component: () => import("@/view/HerosEdit/HerosEdit.vue"),
      },
      //点击跳转编辑文章
      {
        path: "/home/articleEdit",
        component: () => import("@/view/ArticleEdit/ArticleEdit.vue"),
      },
      //点击跳转文章列表
      {
        path: "/home/articleList",
        component: () => import("@/view/ArticleList/ArticleList.vue"),
      },
      //点击编辑跳转添加文章组件
      {
        path: "/home/articleEdit/editArticle/:id",
        name: "editArticle",
        component: () => import("@/view/ArticleEdit/ArticleEdit.vue"),
      },
      //点击跳转编辑广告
      {
        path: "/home/adEdit",
        component: () => import("@/view/AdEdit/Adedit.vue"),
      },
      //点击跳转广告列表
      {
        path: "/home/adList",
        component: () => import("@/view/AdList/AdList.vue"),
      },
      //点击编辑跳转添加广告组件
      {
        path: "/home/ad/editAd/:id",
        name: "editAd",
        component: () => import("@/view/AdEdit/Adedit.vue"),
      },

      //添加管理员
      {path:'/home/adminUserCreate',component:()=>import('@/view/AdminUserCreate/AdminUserCreate.vue')},
      //管理员列表
      {path:'/home/adminUserList',component:()=>import('@/view/AdminUserList/AdminUserList.vue')},
      //点击编辑跳转到添加管理员
      {path:'/home/adminUserCreate/editAdmin/:id',name:'editAdmin',component:()=>import('@/view/AdminUserCreate/AdminUserCreate.vue')}
    ],
  },

    //登录
  {path:'/login',component:()=>import('@/page/Login/Login.vue')}
];

export const router = createRouter({
  history: createWebHistory(),
  routes: routes,
});
